package org.lh.ibernate.core.invoker;

import java.lang.reflect.Proxy;

/*
 *
 * @author idea
 * @date 2018/7/12
 * @param Method method,Object[] args
 * @return Object
 * @des jdk代理工具
 */
public class Invoker<T,PK> {
    public Object getInstance(Class<?> cla) throws ClassNotFoundException {
        MethodProxy<T,PK> methodProxy=new MethodProxy<T,PK>(cla);
        Object newProxyInstance=Proxy.newProxyInstance(
                cla.getClassLoader(),
                new Class[]{cla},
                methodProxy);
        return newProxyInstance;
    }
}
